<template>
  <div class="property-approval">
    <div class="header">
      <router-link to="/main/wuye/process" class="back-btn">
        <i class="el-icon-arrow-left"></i>
        <span>返回</span>
      </router-link>
      <h2>物业审核</h2>
    </div>

    <div class="content">
      <el-tabs v-model="activeTab">
        <el-tab-pane label="待审核" name="pending">
          <el-table :data="pendingList" style="width: 100%">
            <el-table-column prop="repairNo" label="报修编号" width="180"></el-table-column>
            <el-table-column prop="applicant" label="报修人" width="120"></el-table-column>
            <el-table-column prop="location" label="报修位置" width="180">
              <template slot-scope="scope">
                {{ scope.row.location.join(' - ') }}
              </template>
            </el-table-column>
            <el-table-column prop="repairType" label="报修类型" width="120"></el-table-column>
            <el-table-column prop="urgencyLevel" label="紧急程度" width="120">
              <template slot-scope="scope">
                <el-tag :type="getUrgencyType(scope.row.urgencyLevel)">
                  {{ scope.row.urgencyLevel }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="操作" width="200">
              <template slot-scope="scope">
                <el-button size="mini" @click="viewDetail(scope.row)">查看</el-button>
                <el-button size="mini" type="primary" @click="handleApproval(scope.row)">审核</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>

        <el-tab-pane label="已审核" name="completed">
          <el-table :data="completedList" style="width: 100%">
            <el-table-column prop="repairNo" label="报修编号" width="180"></el-table-column>
            <el-table-column prop="applicant" label="报修人" width="120"></el-table-column>
            <el-table-column prop="approvalResult" label="审核结果" width="120">
              <template slot-scope="scope">
                <el-tag :type="scope.row.approvalResult === '通过' ? 'success' : 'danger'">
                  {{ scope.row.approvalResult }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column prop="approvalTime" label="审核时间" width="180"></el-table-column>
            <el-table-column prop="estimatedCost" label="预估费用" width="120">
              <template slot-scope="scope">
                {{ scope.row.estimatedCost }}元
              </template>
            </el-table-column>
            <el-table-column label="操作" width="120">
              <template slot-scope="scope">
                <el-button size="mini" @click="viewDetail(scope.row)">查看</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!-- 详情对话框 -->
    <el-dialog title="报修详情" :visible.sync="detailDialogVisible" width="60%">
      <div class="repair-detail" v-if="currentRepair" ref="printArea">
        <div class="print-header">
          <h1 align="center">深圳市艾美思普科技有限公司</h1>
          <h2 align="center">报修审核单</h2>
        </div>

        <el-descriptions title="基本信息" :column="2" border>
          <el-descriptions-item label="报修编号">{{ currentRepair.repairNo }}</el-descriptions-item>
          <el-descriptions-item label="报修人">{{ currentRepair.applicant }}</el-descriptions-item>
          <el-descriptions-item label="联系电话">{{ currentRepair.phone }}</el-descriptions-item>
          <el-descriptions-item label="报修位置">{{ currentRepair.location.join(' - ') }}</el-descriptions-item>
          <el-descriptions-item label="报修类型">{{ currentRepair.repairType }}</el-descriptions-item>
          <el-descriptions-item label="紧急程度">{{ currentRepair.urgencyLevel }}</el-descriptions-item>
          <el-descriptions-item label="期望维修时间" :span="2">
            {{ formatDateRange(currentRepair.expectedTime) }}
          </el-descriptions-item>
        </el-descriptions>

        <div class="detail-section">
          <h4>故障描述</h4>
          <p>{{ currentRepair.description }}</p>
        </div>

        <div class="detail-section" v-if="currentRepair.remarks">
          <h4>备注</h4>
          <p>{{ currentRepair.remarks }}</p>
        </div>

        <div class="detail-section" v-if="currentRepair.approvalHistory">
          <h4>审核记录</h4>
          <el-timeline>
            <el-timeline-item
              v-for="(history, index) in currentRepair.approvalHistory"
              :key="index"
              :type="history.result === '通过' ? 'success' : 'danger'"
              :timestamp="history.time">
              {{ history.approver }} {{ history.action }}
              <p v-if="history.comment" class="approval-comment">{{ history.comment }}</p>
            </el-timeline-item>
          </el-timeline>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="detailDialogVisible = true">关闭</el-button>
        <el-button type="primary" @click="printDetail">打印</el-button>
      </div>
    </el-dialog>

    <!-- 审核对话框 -->
    <el-dialog title="物业审核" :visible.sync="approvalDialogVisible" width="40%">
      <el-form :model="approvalForm" label-width="100px">
        <el-form-item label="审核结果">
          <el-radio-group v-model="approvalForm.result">
            <el-radio label="通过">通过</el-radio>
            <el-radio label="拒绝">拒绝</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="预估费用" v-if="approvalForm.result === '通过'">
          <el-input-number v-model="approvalForm.estimatedCost" :min="0" :step="100"></el-input-number>
          <span class="unit">元</span>
        </el-form-item>

        <el-form-item label="维修类别" v-if="approvalForm.result === '通过'">
          <el-select v-model="approvalForm.repairCategory">
            <el-option label="免费维修" value="免费维修"></el-option>
            <el-option label="有偿维修" value="有偿维修"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="审核意见">
          <el-input type="textarea" v-model="approvalForm.comment" rows="4"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="approvalDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitApproval">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeTab: 'pending',
      pendingList: [
        {
          repairNo: 'BX202403001',
          applicant: '张三',
          phone: '13800138000',
          location: ['A栋', '1层', '101'],
          repairType: '水电维修',
          urgencyLevel: '紧急',
          description: '水管漏水',
          expectedTime: ['2024-03-20 14:00:00', '2024-03-20 17:00:00']
        }
      ],
      completedList: [
        {
          repairNo: 'BX202403002',
          applicant: '李四',
          approvalResult: '通过',
          approvalTime: '2024-03-15 10:30:00',
          estimatedCost: 200,
          approvalHistory: [
            {
              time: '2024-03-15 10:30:00',
              approver: '王物业',
              action: '审核通过',
              result: '通过',
              comment: '属于正常维修范围，同意维修'
            }
          ]
        }
      ],
      detailDialogVisible: false,
      approvalDialogVisible: false,
      currentRepair: null,
      approvalForm: {
        result: '通过',
        estimatedCost: 0,
        repairCategory: '免费维修',
        comment: ''
      }
    }
  },
  methods: {
    getUrgencyType(level) {
      const map = {
        '一般': 'info',
        '紧急': 'warning',
        '特急': 'danger'
      }
      return map[level] || 'info'
    },
    formatDateRange(range) {
      if (!range || !range.length) return ''
      return `${range[0]} 至 ${range[1]}`
    },
    viewDetail(row) {
      this.currentRepair = row
      this.detailDialogVisible = true
    },
    handleApproval(row) {
      this.currentRepair = row
      this.approvalForm = {
        result: '通过',
        estimatedCost: 0,
        repairCategory: '免费维修',
        comment: ''
      }
      this.approvalDialogVisible = true
    },
    submitApproval() {
      if (!this.approvalForm.comment) {
        this.$message.error('请填写审核意见')
        return
      }

      // TODO: 提交审核结果到后端
      const approvalHistory = {
        time: new Date().toLocaleString(),
        approver: '当前用户',
        action: this.approvalForm.result === '通过' ? '审核通过' : '审核拒绝',
        result: this.approvalForm.result,
        comment: this.approvalForm.comment
      }

      this.currentRepair.approvalResult = this.approvalForm.result
      this.currentRepair.approvalTime = approvalHistory.time
      this.currentRepair.estimatedCost = this.approvalForm.estimatedCost
      this.currentRepair.repairCategory = this.approvalForm.repairCategory
      this.currentRepair.approvalHistory = this.currentRepair.approvalHistory || []
      this.currentRepair.approvalHistory.push(approvalHistory)

      // 从待审核列表移动到已审核列表
      const index = this.pendingList.findIndex(item => item.repairNo === this.currentRepair.repairNo)
      if (index > -1) {
        this.pendingList.splice(index, 1)
        this.completedList.unshift(this.currentRepair)
      }

      this.$message.success('审核提交成功')
      this.approvalDialogVisible = false
    },
    printDetail() {
      const printArea = this.$refs.printArea;
      const originalContent = document.body.innerHTML;
      const vm = this;
      
      // 保存打印内容
      const printContent = printArea.innerHTML;
      
      // 替换页面内容为打印内容
      document.body.innerHTML = `
        <div class="print-container">
          ${printContent}
        </div>
      `;
      
      // 调用打印
      window.print();
      
      // 恢复原页面内容
      document.body.innerHTML = originalContent;
      
      // 重新挂载 Vue 实例
      this.$mount();

      // 重新绑定数据和状态
      this.$nextTick(() => {
        // 恢复对话框状态
        this.detailDialogVisible = true;
        // 恢复当前数据
        this.currentRepair = vm.currentRepair;
      });
    }
  }
}
</script>

<style lang="scss" scoped>
.property-approval {
  padding: 20px;

  .header {
    margin-bottom: 30px;
    position: relative;
    text-align: center;

    .back-btn {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      text-decoration: none;
      color: #606266;
      display: flex;
      align-items: center;
    }

    h2 {
      margin: 0;
      font-size: 24px;
      color: #303133;
    }
  }

  .content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  }

  .detail-section {
    margin-top: 20px;

    h4 {
      margin: 0 0 10px;
      color: #303133;
    }

    p {
      margin: 0;
      color: #606266;
      line-height: 1.6;
    }

    .approval-comment {
      margin: 5px 0 0;
      font-size: 13px;
    }
  }

  .unit {
    margin-left: 10px;
    color: #606266;
  }

  .repair-detail {
    padding: 20px;

    .print-header {
      display: none;
      text-align: center;
      margin-bottom: 20px;

      h1 {
        font-size: 20px;
        margin-bottom: 10px;
      }

      h2 {
        font-size: 18px;
      }
    }
  }
}

/* 打印样式 */
@media print {
  body {
    background: white;
    margin: 0;
    padding: 20mm;
  }

  .repair-detail {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;

    .print-header {
      display: block;
      padding: 10mm 0;
      border-bottom: 2px solid #000;
      margin-bottom: 8mm;
      text-align: center;

      h1 {
        font-size: 22pt;
        margin-bottom: 6mm;
        font-weight: bold;
        text-align: center;
      }

      h2 {
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
      }
    }
  }

  /* 表格样式优化 */
  .el-descriptions {
    margin-bottom: 8mm;
    
    .el-descriptions__header {
      margin-bottom: 4mm;
      text-align: center;
      
      .el-descriptions__title {
        font-size: 14pt;
        font-weight: bold;
        color: #000;
        text-align: center;
        width: 100%;
        display: block;
      }
    }

    .el-descriptions__body {
      width: 100%;

      table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 auto;

        th, td {
          padding: 3mm;
          border: 1px solid #000;
          font-family: SimSun, "宋体", serif !important;
          font-size: 12pt;
          line-height: 1.5;
          text-align: center;
          vertical-align: middle;
        }
        
        th {
          background-color: #f5f5f5 !important;
          font-weight: bold;
          text-align: center;
          width: 25%;
        }
      }
    }
  }

  /* 强制覆盖 Element UI 的默认样式 */
  :deep(.el-descriptions__header) {
    text-align: center !important;
    margin-bottom: 4mm !important;
  }
  
  :deep(.el-descriptions__title) {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
  }

  /* 其他文本内容样式 */
  .detail-section {
    margin-top: 6mm;
    page-break-inside: avoid;
    border: 1px solid #000;
    padding: 4mm;
    border-radius: 2mm;
    text-align: center;

    h4 {
      font-family: SimSun, "宋体", serif !important;
      font-weight: bold;
      margin-bottom: 3mm;
      font-size: 14pt;
      padding-bottom: 2mm;
      border-bottom: 1px solid #000;
      text-align: center;
    }

    p {
      font-family: SimSun, "宋体", serif !important;
      line-height: 1.8;
      font-size: 12pt;
      margin: 0;
      padding: 2mm 0;
      text-align: center;
      width: 100%;
      display: block;
    }

    /* 审核记录部分也居中 */
    .approval-comment {
      text-align: center;
      width: 100%;
      display: block;
      margin: 2mm 0;
    }
  }

  /* 时间线样式 */
  .el-timeline {
    margin-top: 4mm;
    padding: 4mm;
    text-align: center;
    
    .el-timeline-item__content {
      font-family: SimSun, "宋体", serif !important;
      font-size: 12pt;
      line-height: 1.8;
      text-align: center;
      width: 100%;
      display: block;
    }
    
    .el-timeline-item__timestamp {
      font-family: SimSun, "宋体", serif !important;
      font-size: 11pt;
      color: #666 !important;
      text-align: center;
    }
    
    .el-timeline-item__node {
      background-color: #fff !important;
      border: 2px solid #000;
    }
    
    .el-timeline-item__tail {
      border-left: 2px solid #000 !important;
    }
  }

  /* 标签样式 */
  .el-tag {
    border: 1px solid #000;
    font-family: SimSun, "宋体", serif !important;
    padding: 2mm 4mm;
    font-size: 12pt;
    background-color: #fff !important;
    color: #000 !important;
    text-align: center;
    display: inline-block;
  }

  /* 页面设置 */
  @page {
    size: A4;
    margin: 0;
  }
  
  /* 确保打印内容居中 */
  .print-container {
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;
    background: white;
    text-align: center;
  }

  /* 隐藏不需要打印的元素 */
  .el-dialog__header,
  .el-dialog__footer,
  .dialog-footer {
    display: none !important;
  }

  /* 确保所有文字使用宋体 */
  * {
    font-family: SimSun, "宋体", serif !important;
  }
}
</style>     h2 {
      margin: 0;
      font-size: 24px;
      color: #303133;
    }
  }

  .content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  }

  .detail-section {
    margin-top: 20px;

    h4 {
      margin: 0 0 10px;
      color: #303133;
    }

    p {
      margin: 0;
      color: #606266;
      line-height: 1.6;
    }

    .approval-comment {
      margin: 5px 0 0;
      font-size: 13px;
    }
  }

  .unit {
    margin-left: 10px;
    color: #606266;
  }

  .repair-detail {
    padding: 20px;

    .print-header {
      display: none;
      text-align: center;
      margin-bottom: 20px;

      h1 {
        font-size: 20px;
        margin-bottom: 10px;
      }

      h2 {
        font-size: 18px;
      }
    }
  }
}

/* 打印样式 */
@media print {
  body {
    background: white;
    margin: 0;
    padding: 20mm;
  }

  .repair-detail {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;

    .print-header {
      display: block;
      padding: 10mm 0;
      border-bottom: 2px solid #000;
      margin-bottom: 8mm;
      text-align: center;

      h1 {
        font-size: 22pt;
        margin-bottom: 6mm;
        font-weight: bold;
        text-align: center;
      }

      h2 {
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
      }
    }
  }

  /* 表格样式优化 */
  .el-descriptions {
    margin-bottom: 8mm;
    
    .el-descriptions__header {
      margin-bottom: 4mm;
      text-align: center;
      
      .el-descriptions__title {
        font-size: 14pt;
        font-weight: bold;
        color: #000;
        text-align: center;
        width: 100%;
        display: block;
      }
    }

    .el-descriptions__body {
      width: 100%;

      table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 auto;

        th, td {
          padding: 3mm;
          border: 1px solid #000;
          font-family: SimSun, "宋体", serif !important;
          font-size: 12pt;
          line-height: 1.5;
          text-align: center;
          vertical-align: middle;
        }
        
        th {
          background-color: #f5f5f5 !important;
          font-weight: bold;
          text-align: center;
          width: 25%;
        }
      }
    }
  }

  /* 强制覆盖 Element UI 的默认样式 */
  :deep(.el-descriptions__header) {
    text-align: center !important;
    margin-bottom: 4mm !important;
  }
  
  :deep(.el-descriptions__title) {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
  }

  /* 其他文本内容样式 */
  .detail-section {
    margin-top: 6mm;
    page-break-inside: avoid;
    border: 1px solid #000;
    padding: 4mm;
    border-radius: 2mm;
    text-align: center;

    h4 {
      font-family: SimSun, "宋体", serif !important;
      font-weight: bold;
      margin-bottom: 3mm;
      font-size: 14pt;
      padding-bottom: 2mm;
      border-bottom: 1px solid #000;
      text-align: center;
    }

    p {
      font-family: SimSun, "宋体", serif !important;
      line-height: 1.8;
      font-size: 12pt;
      margin: 0;
      padding: 2mm 0;
      text-align: center;
      width: 100%;
      display: block;
    }

    /* 审核记录部分也居中 */
    .approval-comment {
      text-align: center;
      width: 100%;
      display: block;
      margin: 2mm 0;
    }
  }

  /* 时间线样式 */
  .el-timeline {
    margin-top: 4mm;
    padding: 4mm;
    text-align: center;
    
    .el-timeline-item__content {
      font-family: SimSun, "宋体", serif !important;
      font-size: 12pt;
      line-height: 1.8;
      text-align: center;
      width: 100%;
      display: block;
    }
    
    .el-timeline-item__timestamp {
      font-family: SimSun, "宋体", serif !important;
      font-size: 11pt;
      color: #666 !important;
      text-align: center;
    }
    
    .el-timeline-item__node {
      background-color: #fff !important;
      border: 2px solid #000;
    }
    
    .el-timeline-item__tail {
      border-left: 2px solid #000 !important;
    }
  }

  /* 标签样式 */
  .el-tag {
    border: 1px solid #000;
    font-family: SimSun, "宋体", serif !important;
    padding: 2mm 4mm;
    font-size: 12pt;
    background-color: #fff !important;
    color: #000 !important;
    text-align: center;
    display: inline-block;
  }

  /* 页面设置 */
  @page {
    size: A4;
    margin: 0;
  }
  
  /* 确保打印内容居中 */
  .print-container {
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;
    background: white;
    text-align: center;
  }

  /* 隐藏不需要打印的元素 */
  .el-dialog__header,
  .el-dialog__footer,
  .dialog-footer {
    display: none !important;
  }

  /* 确保所有文字使用宋体 */
  * {
    font-family: SimSun, "宋体", serif !important;
  }
}


</style> 

    h2 {
      margin: 0;
      font-size: 24px;
      color: #303133;
    }
  }

  .content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
  }

  .detail-section {
    margin-top: 20px;

    h4 {
      margin: 0 0 10px;
      color: #303133;
    }

    p {
      margin: 0;
      color: #606266;
      line-height: 1.6;
    }

    .approval-comment {
      margin: 5px 0 0;
      font-size: 13px;
    }
  }

  .unit {
    margin-left: 10px;
    color: #606266;
  }

  .repair-detail {
    padding: 20px;

    .print-header {
      display: none;
      text-align: center;
      margin-bottom: 20px;

      h1 {
        font-size: 20px;
        margin-bottom: 10px;
      }

      h2 {
        font-size: 18px;
      }
    }
  }
}

/* 打印样式 */
@media print {
  body {
    background: white;
    margin: 0;
    padding: 20mm;
  }

  .repair-detail {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;

    .print-header {
      display: block;
      padding: 10mm 0;
      border-bottom: 2px solid #000;
      margin-bottom: 8mm;
      text-align: center;

      h1 {
        font-size: 22pt;
        margin-bottom: 6mm;
        font-weight: bold;
        text-align: center;
      }

      h2 {
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
      }
    }
  }

  /* 表格样式优化 */
  .el-descriptions {
    margin-bottom: 8mm;
    
    .el-descriptions__header {
      margin-bottom: 4mm;
      text-align: center;
      
      .el-descriptions__title {
        font-size: 14pt;
        font-weight: bold;
        color: #000;
        text-align: center;
        width: 100%;
        display: block;
      }
    }

    .el-descriptions__body {
      width: 100%;

      table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 auto;

        th, td {
          padding: 3mm;
          border: 1px solid #000;
          font-family: SimSun, "宋体", serif !important;
          font-size: 12pt;
          line-height: 1.5;
          text-align: center;
          vertical-align: middle;
        }
        
        th {
          background-color: #f5f5f5 !important;
          font-weight: bold;
          text-align: center;
          width: 25%;
        }
      }
    }
  }

  /* 强制覆盖 Element UI 的默认样式 */
  :deep(.el-descriptions__header) {
    text-align: center !important;
    margin-bottom: 4mm !important;
  }
  
  :deep(.el-descriptions__title) {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
  }

  /* 其他文本内容样式 */
  .detail-section {
    margin-top: 6mm;
    page-break-inside: avoid;
    border: 1px solid #000;
    padding: 4mm;
    border-radius: 2mm;
    text-align: center;

    h4 {
      font-family: SimSun, "宋体", serif !important;
      font-weight: bold;
      margin-bottom: 3mm;
      font-size: 14pt;
      padding-bottom: 2mm;
      border-bottom: 1px solid #000;
      text-align: center;
    }

    p {
      font-family: SimSun, "宋体", serif !important;
      line-height: 1.8;
      font-size: 12pt;
      margin: 0;
      padding: 2mm 0;
      text-align: center;
      width: 100%;
      display: block;
    }

    /* 审核记录部分也居中 */
    .approval-comment {
      text-align: center;
      width: 100%;
      display: block;
      margin: 2mm 0;
    }
  }

  /* 时间线样式 */
  .el-timeline {
    margin-top: 4mm;
    padding: 4mm;
    text-align: center;
    
    .el-timeline-item__content {
      font-family: SimSun, "宋体", serif !important;
      font-size: 12pt;
      line-height: 1.8;
      text-align: center;
      width: 100%;
      display: block;
    }
    
    .el-timeline-item__timestamp {
      font-family: SimSun, "宋体", serif !important;
      font-size: 11pt;
      color: #666 !important;
      text-align: center;
    }
    
    .el-timeline-item__node {
      background-color: #fff !important;
      border: 2px solid #000;
    }
    
    .el-timeline-item__tail {
      border-left: 2px solid #000 !important;
    }
  }

  /* 标签样式 */
  .el-tag {
    border: 1px solid #000;
    font-family: SimSun, "宋体", serif !important;
    padding: 2mm 4mm;
    font-size: 12pt;
    background-color: #fff !important;
    color: #000 !important;
    text-align: center;
    display: inline-block;
  }

  /* 页面设置 */
  @page {
    size: A4;
    margin: 0;
  }
  
  /* 确保打印内容居中 */
  .print-container {
    width: 100%;
    max-width: 180mm;
    margin: 0 auto;
    background: white;
    text-align: center;
  }

  /* 隐藏不需要打印的元素 */
  .el-dialog__header,
  .el-dialog__footer,
  .dialog-footer {
    display: none !important;
  }

  /* 确保所有文字使用宋体 */
  * {
    font-family: SimSun, "宋体", serif !important;
  }
}